package com.xysq.activity;

import android.content.pm.ActivityInfo;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.view.Window;

import com.nostra13.universalimageloader.core.ImageLoader;
import com.rockcent.action.AppAction;
import com.rockcent.action.impl.AppActionImpl;
import com.umeng.analytics.MobclickAgent;
import com.xysq.XYApplication;
import com.xysq.util.DBHelper;
import com.xysq.util.PropertiesUtil;

import butterknife.ButterKnife;

/**
 * Created by 黄东凯 on 2015/7/14.
 */
public class BaseActivity extends FragmentActivity {
    public AppAction appAction;
    public int currentPage = 1;//起始页
    public final int PAGE_SIZE = 20;//页数
    public final String payPass = "123456";
    protected DBHelper dbHelper;
    protected XYApplication application;
    protected ImageLoader imageLoader;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
        appAction = AppActionImpl.getInstance(this, PropertiesUtil.getXyapiAddress(), PropertiesUtil.getQkapiAddress());
        application = (XYApplication)getApplication();
        dbHelper = application.getDBHelper();
        imageLoader = application.getImageLoader();
    }

    @Override
    public void setContentView(int layoutResID) {
        super.setContentView(layoutResID);
        ButterKnife.inject(this);
    }
}
